
package com.shop.cereshop.admin.controller.wallet;

import com.shop.cereshop.commons.constant.CoReturnFormat;
import com.shop.cereshop.commons.domain.buyer.CereBuyerUser;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.common.PageParam;
import com.shop.cereshop.commons.domain.user.CerePlatformUser;
import com.shop.cereshop.commons.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j;
import com.shop.cereshop.commons.domain.buyer.CereBuyerWithdrawal;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;


/**
 * <p>
 * 前端控制器
 * 钱包提现记录表
 * </p>
 *
 * @author wang.yao
 * @date 2025-08-26
 */
@Slf4j
@RestController
@RequestMapping("/walletWithdrawal")
@Api(value = "WalletWithdrawal", tags = "钱包提现记录表")
public class WalletWithdrawalController {
    @RequestMapping("/wthdrawal")
    @ApiModelProperty(value = "增加用户提现记录")
    public Result<Void> wthdrawal(CereBuyerWithdrawal cereBuyerWithdrawal, HttpServletRequest request) {
        //获取当前登录账户
        CereBuyerUser user = (CereBuyerUser) request.getAttribute("user");
        if (user == null){
            throw new RuntimeException(CoReturnFormat.USER_NOT_EXIST);
        }
        if (cereBuyerWithdrawal.getBuyerUserId()!=null && cereBuyerWithdrawal.getBankName()!=null && cereBuyerWithdrawal.getBankCard()!=null && cereBuyerWithdrawal.getWithdrawalMoney()!=null){


        }
        return Result.success();
    }
    @GetMapping("/getWthdrawal")
    @ApiModelProperty(value = "分页获取用户提现记录")
    public Result<Page<CereBuyerWithdrawal>> getWthdrawal(PageParam pageParam, HttpServletRequest request) {
        //获取当前登录账户
        CerePlatformUser user = (CerePlatformUser)request.getAttribute("user");
        if (user == null){
            throw new RuntimeException(CoReturnFormat.USER_NOT_EXIST);
        }
        return Result.success();
    }


}
